import type { Emp } from "../type";
import request from "../utils/request";

// 访问接口
export function list(): Promise<Emp[]> {
    return request({
        url: "/emp/list",
        method: "get"
    });
}

export function listId(id: string): Promise<Emp> {
    return request({
        url: `/emp/list/${id}`,
        method: "get"
    })
}

export function updateEmp(id: string, data: Emp): Promise<any> {
    return request({
        url: `/emp/update/${id}`,
        method: "post",
        data
    })

}